use std::time::Duration;

use smol::Timer;

#[test]
fn s000001() {
    smol::block_on(async {
        let task = smol::spawn(async {
            loop {
                println!("Even though I'm in an infinite loop, you can still cancel me!");
                Timer::after(Duration::from_secs(1)).await;
            }
        });

        Timer::after(Duration::from_secs(3)).await;
        task.cancel().await;
        Timer::after(Duration::from_secs(2)).await;
    });
}

#[test]
fn s000002() {
    let time = Some("09:12");
    match time {
        Some(m) if m.le("08:30") => println!("08:30"),
        Some(m) if m.le("09:30") => println!("09:30"),
        Some(m) if m.le("10:30") => println!("10:30"),
        _ => println!("else"),
    }
}
